<div class="yuList">
    <div class="yuSuo clearfix" style="float:left;">
        <if condition="$t eq 2">
            <div id="search2">
                <input type="text" id="start_time" name="start_time" placeholder="请选择付款时间" value="<?=$_REQUEST['start_time']?>" readonly /><em></em>
                <input type="text" id="end_time" name="end_time" placeholder="请选择付款时间" value="<?=$_REQUEST['end_time']?>" readonly />
            </div>
            <div id="search3">
            <select name="business_status" style="text-indent: 5px;color:#7f7f7f;">
                <option value="">请选择业务状态</option>
                <option value="1" <?php echo ($_REQUEST['business_status']=='1'?'selected':''); ?> >已付首款</option>
                <option value="2" <?php echo ($_REQUEST['business_status']=='2'?'selected':''); ?> >已付尾款</option>
            </select>
            <select name="car_source" style="text-indent: 5px;color:#7f7f7f;">
                <option value="">请选择车辆来源</option>
               <?php
                foreach(C('CAR_SOURCE') as $k=>$v){
                    echo '<option value="'.$k.'" '.($_REQUEST['car_source']==$k?'selected':'').' >'.$v.'</option>';
                }
               ?>
            </select>
            <select name="location_area" id="la{$t}" class="tracking_list1" style="color:#7f7f7f">
                <if condition="count($bc_city) gt 1">
                    <option value="0">请选择所在地</option>
                </if>
                <foreach name="bc_city" item="vo" key="k">
                    <option value="{$k}" <?=$k == $la ? 'selected' : ''?> >{$vo}</option>
                </foreach>
            </select>
                <script>
                    if({$location_area}!="0" ){
                        $("#la{$t}").val("{$location_area}")
                    }
                </script>
            </div>
        </if>
        <if condition="(($t eq 0) OR ($t eq 1))">
            <select name="location_area" id="la{$t}" class="tracking_list1" style="color:#7f7f7f">
                <if condition="count($bc_city) gt 1">
                    <option value="0">请选择所在地</option>
                </if>
                <foreach name="bc_city" item="vo" key="k">
                    <option value="{$k}" <?=$k == $la ? 'selected' : ''?> >{$vo}</option>
                </foreach>
            </select>
            <script>
                if({$location_area}!="0" ){
                    $("#la{$t}").val("{$location_area}")
                }
            </script>
        </if>
        <input type="text"  name="keyword{$t}"  value="{$params.keyword}" placeholder="车辆编号/拍单号/车主电话/车主姓名" class="suoDian suoDian1" style="width: 220px;"/>
        <input type="button" value="搜索"  class="suoSou" style="width:80px;" />
    </div>
    <div class="clear"></div>
    <table class="table" style="margin-top: 0px;">
        <thead>
            <tr>
                <th width="6%">车辆编号</th>
                <th width="6%">拍单编号</th>
                <th width="15%">车型</th>
                <th width="6%">所在地</th>
                <th width="8%">车主姓名</th>
                <if condition="$t==2">
                    <th width="6%">车辆来源</th>
                    <th style="min-width: 24px;" width="6%">三证合一</th>
                <else/>
                    <th width="10%">车主电话</th>
                </if>
                <if condition="($t==0)"><th width="12%">起付时间</th> <th width="6%">首款</th></if>
                <if condition="($t==1)"><th width="12%">过户完成时间</th><th width="6%">违约重拍</th><th width="8%">尾款</th></if>
                <if condition="($t==2)"><th style="min-width: 24px;" width="4%">付款凭证</th><th width="12%">付款时间</th><th width="6%">发生金额</th></if>
                <th width="8%">付款类型</th>
                <if condition="($t lt 3)"><th width="8%">操作</th></if>
            </tr>
        </thead>
        <tbody>
        <foreach name="list" item="row">
            <tr>
                <td>{$row.car_no}</td>
                <td>{$row.order_no}</td>
                <td><a href="/Car/report/car_id/{$row.car_id}" target="_blank">{$row.car_model}</a></td>
                <td>{$row.location_area_str}</td>
                <td>{$row.seller_name}</td>
                <if condition="$t==2">
                    <td><php>echo C('CAR_SOURCE.'.$row['car_source']);</php></td>
                    <td>
                      <php>
                        if($row['car_source']=='2'){
                            echo ($row['three_in_one']=='1'?'是':'否');
                        }else{
                            echo '--';
                        }
                      </php>
                    </td>
                <else/>
                    <td>{$row.phone}</td>
                </if>
                <if condition="($t==0)">
                    <td>{$row.createtime}</td>
                    <td><?php echo $row['first_money']; ?>元</td>
                </if>
                <if condition="($t==1)">
                    <td>{$row.createtime}</td>
                    <td><?php echo $row['is_dealer_breach']==1 ? "是" : "否" ;?></td>
                    <td><?php echo number_format($row['tail_money']);?>元</td>
                </if>
                <if condition="($t==2)">
                    <td>{$row.prof}</td>
                    <td>{$row.last_update}</td>
                    <td><?php echo ($row['is_game_over']==0 && $row['pay_type']==2)? number_format($row['amount'] + $row['bid_up_price'],2): $row['amount'] ; ?>元</td></if>
                <if condition="($t==0)"><td>待付首款</td></if>
                <if condition="($t==1)"><td>待付尾款</td></if>
                <if condition="($t==2)"><td><if condition="$row['pay_type'] eq 1">已付首款<else/>已付尾款</if></td></if>
                <if condition="($t==3)"><td>交易关闭</td></if>

                    <if condition="($t==0)"><td><a href="/Finance/pay_info/id/{$row.pay_id}/status/{$t+1}">付首款</a> </td></if>
                    <if condition="($t==1)"><td><a href="/Finance/pay_info/id/{$row.pay_id}/status/{$t+1}">付尾款</a></td> </if>
                    <if condition="($t==2)">
                      <td>
                          <a href="javascript:sendMsg('{$row.order_id}')">发送</a>
                          <a href="/Finance/pay_info/id/{$row.pay_id}/status/{$t+1}" target="_blank">查看</a>
                      </td>
                    </if>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>

    <div class="pageFaye">
      <div class="pager">
          {$page_data.totalRows} 条记录 {$page_data.nowPage}/{$page_data.totalPages} 页
          <span name="first" class="disabled" style="cursor: default;"><a num="{$page_data.first.num}" onclick="fnSearch('<?php echo $t; ?>',$(this).attr('num'));return false;" href="{$page_data.first.url}">首页</a></span>
        <span name="prev" class="disabled" style="cursor: default;"><a onclick="fnSearch('<?php echo $t; ?>',$(this).attr('num'));return false;"  num="{$page_data.prev.num}" href="{$page_data.prev.url}">上一页</a></span>
        <span name="nav" style="cursor: pointer;">
          <?php foreach ($page_data['link_page'] as $page => $link): ?>
            <?php if($page == $p){ ?>
              <a class="navi"  num="<?php echo $page;?>" onclick="fnSearch('<?php echo $t; ?>',$(this).attr('num'));return false;"  href="<?php echo $link;?>">
              <font style="color:#fff"><?php echo $page;?></font>
              </a>  
            <?php }else{?>
              <a class="navi"  num="<?php echo $page;?>" onclick="fnSearch('<?php echo $t; ?>',$(this).attr('num'));return false;"  href="<?php echo $link;?>">
                <?php echo $page;?>
              </a>
            <?php }?>
          <?php endforeach; ?>               
        </span>
        <span name="next" class="pageNext" style="cursor: pointer;"><a onclick="fnSearch('<?php echo $t; ?>',$(this).attr('num'));return false;"  num="{$page_data.next.num}"  href="{$page_data.next.url}">下一页</a></span>
        <span name="last" class="pageLast" style="cursor: pointer;"><a onclick="fnSearch('<?php echo $t; ?>',$(this).attr('num'));return false;"  num="{$page_data.end.num}"  href="{$page_data.end.url}">末页</a></span>
      </div>
      <div class="clear"></div>
    </div>
</div>
<script type="text/javascript">$(function(){$("input").placeholder();});</script>
<script>
    var t = '{$t}';
    function fnSearch(t,p){
              var start_time = $('input[name=start_time]').val();
              var end_time = $('input[name=end_time]').val();
              var business_status = $('select[name=business_status]').val();
              var car_source = $('select[name=car_source]').val();
              var la0 = $('#la0').val();
              var la1 = $('#la1').val();
              var la2 = $('#la2').val();
              var la;
              switch(t){
                case '0':la=la0;break;
                case '1':la=la1;break;
                case '2':la=la2;break;
              }
              var keyword0 = $('input[name=keyword0]').val();
              var keyword1 = $('input[name=keyword1]').val();
              var keyword2 = $('input[name=keyword2]').val();
              var keyword3 = $('input[name=keyword3]').val();
              var keyword;
              switch(t){
                    case '0':keyword=keyword0;break;
                    case '1':keyword=keyword1;break;
                    case '2':keyword=keyword2;break;
                    case '3':keyword=keyword3;break;
              }
              Finance.get(t,p,start_time,end_time,business_status,car_source,la,keyword);
    }
    $(".suoSou").click(function(){
        fnSearch(t,1);
    });
    if(t=='2'){
            $("#start_time").ymdateplugin({
              changeMonth: true,
              changeYear: true
            });

            $("#end_time").ymdateplugin({
              changeMonth: true,
              changeYear: true
            });
    }
</script>
